<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
  <meta name="description" content="API docs for the buildTopWidget method from the ImageField class, for the Dart programming language.">
  <title>buildTopWidget method - ImageField class - creator library - Dart API</title>


  
  <link rel="preconnect" href="https://fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" rel="stylesheet">
  
  <link rel="stylesheet" href="../../static-assets/github.css?v1">
  <link rel="stylesheet" href="../../static-assets/styles.css?v1">
  <link rel="icon" href="../../static-assets/favicon.png?v1">

  
</head>


<body data-base-href="../../" data-using-base-href="false" class="light-theme">

<div id="overlay-under-drawer"></div>

<header id="title">
  <span id="sidenav-left-toggle" class="material-symbols-outlined" role="button" tabindex="0">menu</span>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="../../index.html">yuuna</a></li>
    <li><a href="../../creator/creator-library.html">creator</a></li>
    <li><a href="../../creator/ImageField-class.html">ImageField</a></li>
    <li class="self-crumb">buildTopWidget method</li>
  </ol>
  <div class="self-name">buildTopWidget</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
  <div class="toggle" id="theme-button">
    <label for="theme">
      <input type="checkbox" id="theme" value="light-theme">
      <span id="dark-theme-button" class="material-symbols-outlined">
        brightness_4
      </span>
      <span id="light-theme-button" class="material-symbols-outlined">
        brightness_5
      </span>
    </label>
  </div>
</header>
<main>

  <div id="dartdoc-main-content" class="main-content">
      <div>
<h1><span class="kind-method">buildTopWidget</span> method 
</h1></div>

    <section class="multi-line-signature">
      
  <div>
    <ol class="annotation-list">
        <li>@<a href="https://api.flutter.dev/flutter/dart-core/override-constant.html">override</a></li>
    </ol>
  </div>

<span class="returntype"><a href="https://api.flutter.dev/flutter/widgets/Widget-class.html">Widget</a></span>
<span class="name ">buildTopWidget</span>(<wbr><ol class="parameter-list"><li><span class="parameter" id="buildTopWidget-param-context">{<span>required</span> <span class="type-annotation"><a href="https://api.flutter.dev/flutter/widgets/BuildContext-class.html">BuildContext</a></span> <span class="parameter-name">context</span>, </span></li>
<li><span class="parameter" id="buildTopWidget-param-ref"><span>required</span> <span class="type-annotation"><a href="https://pub.dev/documentation/flutter_riverpod/1.0.4/flutter_riverpod/WidgetRef-class.html">WidgetRef</a></span> <span class="parameter-name">ref</span>, </span></li>
<li><span class="parameter" id="buildTopWidget-param-appModel"><span>required</span> <span class="type-annotation"><a href="../../models/AppModel-class.html">AppModel</a></span> <span class="parameter-name">appModel</span>, </span></li>
<li><span class="parameter" id="buildTopWidget-param-creatorModel"><span>required</span> <span class="type-annotation"><a href="../../models/CreatorModel-class.html">CreatorModel</a></span> <span class="parameter-name">creatorModel</span>, </span></li>
<li><span class="parameter" id="buildTopWidget-param-orientation"><span>required</span> <span class="type-annotation"><a href="https://api.flutter.dev/flutter/widgets/Orientation.html">Orientation</a></span> <span class="parameter-name">orientation</span>}</span></li>
</ol>)

      <div class="features"><span class="feature">override</span></div>

    </section>
    
<section class="desc markdown">
  <p>Media fields are special and have a <a href="https://api.flutter.dev/flutter/widgets/Widget-class.html">Widget</a> that is shown at the top of
the Card Creator.</p>
</section>


    
<section class="summary source-code" id="source">
  <h2><span>Implementation</span></h2>
  <pre class="language-dart"><code class="language-dart">@override
Widget buildTopWidget({
  required BuildContext context,
  required WidgetRef ref,
  required AppModel appModel,
  required CreatorModel creatorModel,
  required Orientation orientation,
}) {
  if (isSearching) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        if (orientation == Orientation.landscape)
          Flexible(
            child: Container(
              color: Colors.transparent,
              height: double.infinity,
              width: double.infinity,
            ),
          )
        else
          AspectRatio(
            aspectRatio: 16 &#47; 9,
            child: Container(
              color: Colors.transparent,
              height: double.infinity,
              width: double.infinity,
            ),
          ),
        const Space.normal(),
        buildFooterLoading(
          appModel: appModel,
          context: context,
        ),
      ],
    );
  }

  if (!showWidget) {
    return const SizedBox.shrink();
  }

  int itemCount = currentImageSuggestions!.length;

  return Column(
    mainAxisAlignment: MainAxisAlignment.center,
    children: [
      if (orientation == Orientation.landscape)
        Flexible(
          child: buildCarousel(
            itemCount: itemCount,
            appModel: appModel,
          ),
        )
      else
        buildCarousel(
          itemCount: itemCount,
          appModel: appModel,
        ),
      const Space.normal(),
      ValueListenableBuilder&lt;int?&gt;(
        valueListenable: indexNotifier,
        builder: (context, index, _) =&gt; buildFooterTextSpans(
          context: context,
          appModel: appModel,
          itemCount: itemCount,
        ),
      ),
    ],
  );
}</code></pre>
</section>


  </div> <!-- /.main-content -->

  <div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
    <header id="header-search-sidebar" class="hidden-l">
  <form class="search-sidebar" role="search">
    <input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>

<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
  <li><a href="../../index.html">yuuna</a></li>
  <li><a href="../../creator/creator-library.html">creator</a></li>
  <li><a href="../../creator/ImageField-class.html">ImageField</a></li>
  <li class="self-crumb">buildTopWidget method</li>
</ol>


    <h5>ImageField class</h5>
    <ol>



        <li class="section-title inherited">
          <a href="../../creator/ImageField-class.html#instance-properties">Properties</a>
        </li>
          <li class="inherited"><a href="../../creator/ImageExportField/carouselKey.html">carouselKey</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/carouselNotifier.html">carouselNotifier</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/currentImageSuggestions.html">currentImageSuggestions</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/currentSearchTerm.html">currentSearchTerm</a></li>
          <li class="inherited"><a href="../../creator/Field/description.html">description</a></li>
          <li class="inherited"><a href="../../creator/Field/descriptionLocalisation.html">descriptionLocalisation</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/exportFile.html">exportFile</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/hashCode.html">hashCode</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/foundation/ChangeNotifier/hasListeners.html">hasListeners</a></li>
          <li class="inherited"><a href="../../creator/Field/icon.html">icon</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/indexNotifier.html">indexNotifier</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/isSearching.html">isSearching</a></li>
          <li class="inherited"><a href="../../creator/Field/label.html">label</a></li>
          <li class="inherited"><a href="../../creator/Field/labelLocalisation.html">labelLocalisation</a></li>
          <li class="inherited"><a href="../../creator/Field/maxLines.html">maxLines</a></li>
          <li class="inherited"><a href="../../creator/Field/multiline.html">multiline</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html">runtimeType</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/selectedIndex.html">selectedIndex</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/showWidget.html">showWidget</a></li>
          <li class="inherited"><a href="../../creator/Field/uniqueKey.html">uniqueKey</a></li>

        <li class="section-title"><a href="../../creator/ImageField-class.html#instance-methods">Methods</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/foundation/ChangeNotifier/addListener.html">addListener</a></li>
          <li><a href="../../creator/ImageField/buildCarousel.html">buildCarousel</a></li>
          <li><a href="../../creator/ImageField/buildFooterLoading.html">buildFooterLoading</a></li>
          <li><a href="../../creator/ImageField/buildFooterTextSpans.html">buildFooterTextSpans</a></li>
          <li><a href="../../creator/ImageField/buildImage.html">buildImage</a></li>
          <li><a href="../../creator/ImageField/buildTopWidget.html">buildTopWidget</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/clearFieldState.html">clearFieldState</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/foundation/ChangeNotifier/dispose.html">dispose</a></li>
          <li class="inherited"><a href="../../creator/Field/getLocalisedDescription.html">getLocalisedDescription</a></li>
          <li class="inherited"><a href="../../creator/Field/getLocalisedLabel.html">getLocalisedLabel</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/getSearchTermWithFallback.html">getSearchTermWithFallback</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/foundation/ChangeNotifier/notifyListeners.html">notifyListeners</a></li>
          <li><a href="../../creator/ImageField/onCreatorOpenAction.html">onCreatorOpenAction</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/foundation/ChangeNotifier/removeListener.html">removeListener</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/setImages.html">setImages</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/setSearching.html">setSearching</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/setSearchSuggestions.html">setSearchSuggestions</a></li>
          <li class="inherited"><a href="../../creator/ImageExportField/setSelectedSearchSuggestion.html">setSelectedSearchSuggestion</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/toString.html">toString</a></li>

        <li class="section-title inherited"><a href="../../creator/ImageField-class.html#operators">Operators</a></li>
          <li class="inherited"><a href="https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html">operator ==</a></li>


        <li class="section-title"><a href="../../creator/ImageField-class.html#static-properties">Static properties</a></li>
          <li><a href="../../creator/ImageField/instance.html">instance</a></li>


        <li class="section-title"><a href="../../creator/ImageField-class.html#constants">Constants</a></li>
          <li><a href="../../creator/ImageField/key-constant.html">key</a></li>
</ol>

  </div><!--/.sidebar-offcanvas-->

  <div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
  </div><!--/.sidebar-offcanvas-->

</main>

<footer>
  <span class="no-break">
    yuuna
      2.8.0+93
  </span>

  
</footer>



<script src="../../static-assets/highlight.pack.js?v1"></script>
<script src="../../static-assets/docs.dart.js"></script>



</body>

</html>

